﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Internal.Master" Inherits="BPM.Web.ViewPage<MaterialDefinition>" %>

<%@ Import Namespace="BPM" %>
<%@ Import Namespace="BPM.Entity" %>
<asp:Content ID="c1" ContentPlaceHolderID="TitleContent" runat="server">
	修改物料信息
</asp:Content>
<asp:Content ID="c3" ContentPlaceHolderID="ScriptStyleContent" runat="server">
	<script src="<%:url("~/Views/MaterialManagement/AddMaterial.js") %>" type="text/javascript"></script>
	<%
		var error = this.ViewData["Error"] as string;
		var bigCatesJson = this.ViewData["AllBigCates"] as string;
		var selectedSubCateId = this.Model.CategoryId;
		var selectedBigCateId = 0;
		if (selectedSubCateId > 0)
		{
			selectedBigCateId = this.Model.Category.ParentCategoryId.Value;
		}
	%>
	<script type="text/javascript">
		error = '<%:error %>';
		bigCates = <%=bigCatesJson %>;
		selectedBigCateId = <%:selectedBigCateId %>;
		selectedSubCateId = <%:selectedSubCateId %>;
	</script>
</asp:Content>
<asp:Content ID="c2" ContentPlaceHolderID="MainContent" runat="server">
	<%
		var deliveryList = new MultiSelectList(new string[] { "日", "周", "月", "年" });
		var ad = AD.Singleton.MaterialManagement;
		using (Html.BeginForm(ad.ModifyMaterial, ad))
		{
	%>
	<%: Html.HiddenFor(m => m.Id) %>
	<table id="tableAddMaterial" class="inputTable">
		<tbody>
			<tr>
				<th>
					物料名称
				</th>
				<td>
					<%: Html.TextBoxFor(m => m.Name)%>
					<span class="requiredTag">*</span>
				</td>
			</tr>
			<tr>
				<th>
					所属大类
				</th>
				<td>
					<select name="BigCategoryId" id="BigCategoryId">
						<option selected="selected">框架</option>
						<option>内部部件</option>
						<option>外部部件</option>
					</select>&nbsp;<span class="requiredTag">*</span>
				</td>
			</tr>
			<tr>
				<th>
					所属小类
				</th>
				<td>
					<select name="CategoryId" id="CategoryId">
						<option>铜片</option>
						<option>银丝</option>
						<option>夜光漆</option>
					</select>&nbsp;<span class="requiredTag">*</span>
				</td>
			</tr>
			<tr>
				<th>
					品牌
				</th>
				<td>
					<%: Html.TextBoxFor(m => m.Brand)%>
				</td>
			</tr>
			<tr>
				<th>
					价格（元）
				</th>
				<td>
					<%: Html.TextBoxFor(m => m.Price)%>
				</td>
			</tr>
			<tr>
				<th>
					供应商名称
				</th>
				<td>
					<%: Html.TextBoxFor(m => m.SupplierName)%>
				</td>
			</tr>
			<tr>
				<th>
					联系人
				</th>
				<td>
					<%: Html.TextBoxFor(m => m.ContactName)%>
				</td>
			</tr>
			<tr>
				<th>
					联系电话
				</th>
				<td>
					<%: Html.TextBoxFor(m => m.ContactPhone)%>
				</td>
			</tr>
			<tr>
				<th>
					其他联系方式
				</th>
				<td>
					<%: Html.TextBoxFor(m => m.OtherContact)%>
				</td>
			</tr>
			<tr>
				<th>
					供货周期
				</th>
				<td>
					<%: Html.TextBoxFor(m => m.DeliveryPeriod, new { size = "5" })%>
					<%: Html.DropDownListFor(m => m.DeliverPeriodUnit, deliveryList, new { style = "width: 100px;" })%>
				</td>
			</tr>
			<tr>
				<th>
					付款方式
				</th>
				<td>
					<%: Html.TextBoxFor(m => m.PaymentMode)%>
				</td>
			</tr>
			<tr>
				<th>
					备注
				</th>
				<td>
					<%: Html.TextAreaFor(m => m.Remark, 5, 25, null)%>
				</td>
			</tr>
			<tr>
				<th>
				</th>
				<td>
					<input type="submit" value="提交" />
					<input type="button" value="取消" onclick="returnBack();" />
				</td>
			</tr>
		</tbody>
	</table>
	<%
}
	%>
</asp:Content>
